#region Usings

using System;
using System.Collections.Generic;
using System.Linq;
using Karma.Framework.Core.Repository;
using Karma.Framework.Core.Repository.Generic;
using IQueryable=Karma.Framework.Core.Repository.IQueryable;

#endregion

namespace Karma.Framework.Core.Domain
{
    public class EnumDescriptorService : IEnumDescriptorService
    {
        #region IEnumDescriptorService Members

        public IEnumerable<EnumDescription> GetEnumDescriptions()
        {
            return (from e in EnumDescriptor.GetEnums().Select(c => c.FullName)
                    select new EnumDescription
                               {
                                   Name = e,
                                   Description = EnumDescriptor.GetDescriptions(e).Select(
                                       (d, idx) => new EnumPropertyDescription {Id = idx, Name = d.Value})
                               });
        }

        public DomainObject Get(Int64 primaryKey)
        {
            throw new InvalidOperationException();
        }

        public void Delete(Int64 primaryKey)
        {
            throw new InvalidOperationException();
        }

        public DomainObject Update(DomainObject instance)
        {
            throw new InvalidOperationException();
        }

        public DomainObject Save(DomainObject instance)
        {
            throw new InvalidOperationException();
        }

        #endregion

        public QueryResult Find(QuerySpecification specification)
        {
            throw new InvalidOperationException();
        }
    }
}